<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>全球商业联盟通用积分促销实时交易结算数据中心</title>
    <link href="__CSS__/bootstrap.css?v=3.3.7" rel="stylesheet">
    <link href="__JS__/plugins/layui/css/layui.css" rel="stylesheet">
    <style>
        html, body {
            height: 100%;
        }
		.layui-table td, .layui-table th{
			padding: 9px 0;
		}
        body {
            background-color: #000000;
            margin: 0;
            font-family: Helvetica, sans-serif;;
            overflow: hidden;
        }
        #info {
            position: absolute;
            width: 100%;
            color: rgba(127,255,255,0.75);
            padding: 5px;
            font-family: Monospace;
            font-size: 34px;
            font-weight: bold;
            text-align: center;
            z-index: 1;
            margin-top:10px;
        }
        #msg{
            position: absolute;
            width: 100%;
            color: #FB7A29;
            padding: 5px;
            font-family: Monospace;
            font-size: 24px;
            font-weight: bold;
            text-align: center;
            z-index: 1;
            margin-top:60px;
        }

        #logo {
            position: absolute;
            width: 100%;
            padding: 10px;
            text-align: left;
            z-index: 1;
        }
        #logo img{
            width:90px;
            height:90px;
            /*object-fit: cover;*/
        }
        #logo span{
            display: inline-block;
            color:#FB7A29;
            font-size: 40px;
        }
        .layui-table th {
            font-weight: bold;
            font-size: 16px;
            color:#37C5F3;
            text-align: center;
        }
        .layui-table td {
            color:#37C5F3;
        }
        .layui-table {
            background-color: #2e2e2e;
            /*opacity: 0.7;*/
        }
        .layui-table thead tr{
            background-color:  #2e2e2e;
        }
        .layui-table tr{
            text-align: center;
        }
        .title{
            width:100%;
            height:38px;
            color:#37C5F3;
            font-weight: bold;
            font-size:17px;
            text-align: center;
            line-height: 39px;
            background-color: #375EA6;
            margin-top:10px;
        }
        .layui-table, .layui-table-view{
            margin-top:0px;
        }
    </style>
</head>
<body>
<div id="logo">
    <div style="float:left;">
        <img src="/static/admin/images/jf2.png"  >
    </div>
    <div style="float:left;margin-left:10px;text-align: center">
        <span></span><br>
        <span style="font-size:25px;"></span>
    </div>
</div>
<div id="info">全球商业联盟通用积分促销实时交易结算数据中心</div>
<div id="msg">
    <span style="display: inline-block;margin-right: 60px;">今日新增会员人数：<span style="font-size:32px;font-weight: bold;" id="new">{$new}</span>（人）</span>
    <span>今日交易额：<span style="font-size:32px;font-weight: bold;" id="sum">{$sum}</span>（积分）</span>
</div>
<!--#000000-->
<div class="col-sm-3" style="height:auto;position:absolute;top:160px;bottom: 20px;left: 0;padding:0px;" >
    <div class="col-sm-12" style="width:100%;height:50%;overflow: hidden;">
        <div class="title">积分交易额排行</div>
        <table class="layui-table" lay-skin="nob">
           <colgroup>
               <col width="25%">
               <col width="25%">
               <col width="25%">
               <col>
           </colgroup>
           <thead>
               <tr>
                   <th>排名</th>
                   <th>地区</th>
                   <th>数额</th>
                   <th>扫码</th>
               </tr>
           </thead>
           <tbody>
               {foreach name="integral" item="vo" key="key" }
                   <tr>
                       <td>{$key+1}</td>
                       <td>{$vo.district}</td>
                       <td>{$vo.jifen}</td>
                       <td>{$vo.record}</td>
                   </tr>
               {/foreach}
           </tbody>
       </table>
    </div>
    <div class="col-sm-12" style="width:100%;height:50%;overflow: hidden;">
        <div class="title">现金交易额排行</div>
        <table class="layui-table" lay-skin="nob">
            <colgroup>
                <col width="25%">
                <col width="25%">
                <col width="25%">
                <col>
            </colgroup>
            <thead>
                <tr>
                    <th>排名</th>
                    <th>地区</th>
                    <th>数额</th>
                    <th>扫码</th>
                </tr>
            </thead>
            <tbody>
                {foreach name="money" item="vo" key="key" }
                    <tr>
                        <td>{$key+1}</td>
                        <td>{$vo.district}</td>
                        <td>{$vo.money}</td>
                        <td>{$vo.record}</td>
                    </tr>
                {/foreach}
            </tbody>
        </table>
    </div>
</div>
<div class="col-sm-6" style="height:auto;margin:auto;position:absolute;top:160px;bottom: 20px;right: 0;left: 0;padding:0px;" id="echarts-china-chart"></div>
<div class="col-sm-3" style="height:auto;margin:auto;position:absolute;top:160px;bottom: 20px;right: 0;padding:0px;" >
    <div class="col-sm-12" style="width:100%;height:50%;overflow: hidden;padding-top:10px;">
        <div id="echarts-pie-chart" style="width:100%;height:100%;background-color: #2e2e2e;"></div>
    </div>
    <div class="col-sm-12" style="width:100%;height:50%;overflow: hidden;padding-top:10px;">
        <div id="echarts-line-chart" style="width:100%;height:100%;background-color: #2e2e2e;"></div>
    </div>
</div>
<script src="/static/admin/js/jquery.min.js"></script>
<script src="__JS__/echarts.min.js"></script>
<script type="text/javascript" src="/static/admin/center/js/china.js"></script>
<script>
    setInterval(function () {
        $.ajax({
            url:"/admin/center/flush",
            type:"get",
            dataType:"json",
            success:function (res) {
                $("#new").text(res.msg.new)
                $("#sum").text(res.msg.sum)
                // $("#member").text(res.member)
            }
        })
    },5000);

    var member = {$member};
    var line = echarts.init(document.getElementById("echarts-line-chart")),
        option1 = {
            title : {
                text: '会员注册数排行',
                x:'center',
                textStyle:{
                    color:"#fff"
                }
            },
            tooltip: {
                trigger: 'axis'
            },
            xAxis: {
                type: 'category',
                data: member.name,
                axisLine:{
                    lineStyle:{
                        color:"#fff"
                    }
                }
            },
            yAxis: {
                type: 'value',
                axisLine:{
                    lineStyle:{
                        color:"#fff"
                    }
                }
            },
            series: [{
                data: member.value,
                name: '注册总量',
                type: 'line',
                smooth: true, //是否平滑曲线显示
                showAllSymbol: true,
                symbol: 'circle',
                symbolSize: 6,
                lineStyle: {
                    normal: {
                        color: "#fff", // 线条颜色
                    },
                },
                label: {
                    show: true,
                    position: 'top',
                    textStyle: {
                        color: '#fff',
                    }
                },
                itemStyle: {
                    color: "red",
                    borderColor: "#fff",
                    borderWidth: 3
                },
            }]
        };
    line.setOption(option1), $(window).resize(line.resize);
</script>
<script>
    var pie = echarts.init(document.getElementById("echarts-pie-chart")),
        option = {
            title : {
                text: '商家入驻数排行',
                x:'center',
                textStyle:{
                    color:"#fff"
                }
            },
            tooltip: {
                trigger: 'item',
                formatter: "{a} <br/>{b}: {c} ({d}%)"
            },
            series: [
                {
                    name:'商家入驻数',
                    type:'pie',
                    radius: ['35%', '55%'],
                    avoidLabelOverlap: true,
                    label: {
                        normal: {
                            show: true,
                            position: 'left',
                            formatter: "{b}{d}%"
                        },
                        emphasis: {
                            show: true,
                            textStyle: {
                                // fontSize: '30',
                                // fontWeight: 'bold'
                            }
                        }
                    },
                    labelLine: {
                        normal: {
                            show: true
                        }
                    },
                    data:{$shop}
                }
            ]
        };
    pie.setOption(option), $(window).resize(pie.resize);
</script>
<script>
    var l = echarts.init(document.getElementById("echarts-china-chart"));

    var data = {$data};
    var geoCoordMap = {$map};

    var convertData = function (data) {
        var res = [];
        for (var i = 0; i < data.length; i++) {
            var geoCoord = geoCoordMap[data[i].name];
            if (geoCoord) {
                res.push({
                    name: data[i].name,
                    value: geoCoord.concat(data[i].value)
                });
            }
        }
        return res;
    };

    u = {

        // backgroundColor: '#404a59',

        legend: {
            show:false
        },
        geo: {
            map: 'china',
            label: {
                emphasis: {
                    show: false
                }
            },
            roam: true,
            itemStyle: {
                normal: {
                    areaColor: '#323c48',
                    borderColor: '#111'
                },
                emphasis: {
                    areaColor: '#2a333d'
                }
            }
        },
        series : [
            {
                type: 'effectScatter',
                coordinateSystem: 'geo',
                data: convertData(data.sort(function (a, b) {
                    return b.value - a.value;
                }).slice(0, 50)),
                symbolSize: function (val) {
                    return val[2] / 5;
                },
                showEffectOn: 'render',
                rippleEffect: {
                    brushType: 'stroke'
                },
                hoverAnimation: true,
                label: {
                    normal: {
                        formatter: '{b}',
                        position: 'right',
                        show: true
                    }
                },
                itemStyle: {
                    normal: {
                        color: '#f4e925',
                        shadowBlur: 10,
                        shadowColor: '#333'
                    }
                },
                zlevel: 1
            }
        ]
    };
    l.setOption(u), $(window).resize(l.resize);
    setTimeout(function () {
        window.location.reload();
    },60000)
</script>
</body>
</html>